Skip to content

fix(core): bound ripgrep search execution with default wall-clock deadline (#39208) - #39298

Closed
loulanyue wants to merge 901 commits into
anomalyco:devfrom
loulanyue:fix/39208-bounded-glob-grep-search-execution
Closed

fix(core): bound ripgrep search execution with default wall-clock deadline (#39208)#39298
loulanyue wants to merge 901 commits into
anomalyco:devfrom
loulanyue:fix/39208-bounded-glob-grep-search-execution

Conversation

@loulanyue

Copy link
Copy Markdown

Issue for this PR

Closes #39208

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When executing , , or searches over large workspaces or broad roots without specific filters, ripgrep execution had no internal deadline. In sessions with many matching lines, could block indefinitely if ripgrep stalled, resulting in 21+ minute session hangs.

This PR:

  1. Defines (30 seconds) in .
  2. Adds optional to , , and .
  3. Passes to , gracefully catching abort signals and returning partial results collected up to that point with .
  4. Adds a unit test in verifying search execution completes within the timeout deadline.

How did you verify your code works?

  • Ran bun test v1.3.14 (0d9b296a) (4/4 passed).
  • Ran bun test v1.3.14 (0d9b296a) (2/2 passed).
  • Ran bun test v1.3.14 (0d9b296a) (11/11 passed).
  • Ran
    • Packages in scope: @opencode-ai/ai, @opencode-ai/app, @opencode-ai/cli, @opencode-ai/client, @opencode-ai/codemode, @opencode-ai/console-app, @opencode-ai/console-core, @opencode-ai/console-function, @opencode-ai/console-mail, @opencode-ai/console-resource, @opencode-ai/console-support, @opencode-ai/core, @opencode-ai/desktop, @opencode-ai/effect-drizzle-sqlite, @opencode-ai/effect-sqlite-node, @opencode-ai/enterprise, @opencode-ai/function, @opencode-ai/http-recorder, @opencode-ai/httpapi-codegen, @opencode-ai/plugin, @opencode-ai/protocol, @opencode-ai/schema, @opencode-ai/script, @opencode-ai/sdk-next, @opencode-ai/server, @opencode-ai/session-ui, @opencode-ai/simulation, @opencode-ai/slack, @opencode-ai/stats-app, @opencode-ai/stats-core, @opencode-ai/stats-server, @opencode-ai/storybook, @opencode-ai/tui, @opencode-ai/ui, @opencode-ai/updates, @opencode-ai/util, @opencode-ai/web, @opencode-ai/www
    • Running typecheck in 38 packages
    • Remote caching disabled

@opencode-ai/desktop:typecheck: cache hit, replaying logs 1c0eb4eb9d5d1381
@opencode-ai/tui:typecheck: cache hit, replaying logs d0ee3b06c0d416a5
@opencode-ai/client:typecheck: cache hit, replaying logs dc67a090cc9fd054
@opencode-ai/simulation:typecheck: cache hit, replaying logs fc3fdf2e3f151dc2
@opencode-ai/http-recorder:typecheck: cache hit, replaying logs 19c176948b66527b
@opencode-ai/cli:typecheck: cache hit, replaying logs 7c0836beddbbd2be
@opencode-ai/http-recorder:typecheck: $ tsgo --noEmit && tsgo -p test/tsconfig.json --noEmit
@opencode-ai/desktop:typecheck: $ tsgo -b
@opencode-ai/console-app:typecheck: cache hit, replaying logs bbea3820a325a48c
@opencode-ai/stats-core:typecheck: cache hit, replaying logs c8d12bb65952bd45
@opencode-ai/tui:typecheck: $ tsgo --noEmit
@opencode-ai/cli:typecheck: $ tsgo --noEmit
@opencode-ai/simulation:typecheck: $ tsgo --noEmit
@opencode-ai/client:typecheck: $ tsgo --noEmit
@opencode-ai/stats-core:typecheck: $ tsgo --noEmit
@opencode-ai/console-app:typecheck: $ tsgo --noEmit
@opencode-ai/protocol:typecheck: cache hit, replaying logs ea852b2c88bc37a1
@opencode-ai/protocol:typecheck: $ tsgo --noEmit
@opencode-ai/console-core:typecheck: cache hit, replaying logs 392bf7443a8afe7d
@opencode-ai/updates:typecheck: cache hit, replaying logs 26bbfaa0d74068b3
@opencode-ai/console-core:typecheck: $ tsgo --noEmit
@opencode-ai/updates:typecheck: $ tsgo --noEmit
@opencode-ai/session-ui:typecheck: cache hit, replaying logs 50408dfadb21224d
@opencode-ai/session-ui:typecheck: $ tsgo --noEmit
@opencode-ai/stats-app:typecheck: cache hit, replaying logs e01e165329bd926d
@opencode-ai/console-function:typecheck: cache hit, replaying logs 8119110745f017c9
@opencode-ai/stats-app:typecheck: $ tsgo --noEmit
@opencode-ai/plugin:typecheck: cache hit, replaying logs 607f82a5428e2a55
@opencode-ai/www:typecheck: cache hit, replaying logs 9bf77a282dd337b8
@opencode-ai/console-function:typecheck: $ tsgo --noEmit
@opencode-ai/stats-server:typecheck: cache hit, replaying logs db799dc0926333da
@opencode-ai/plugin:typecheck: $ tsgo --noEmit
@opencode-ai/stats-server:typecheck: $ tsgo --noEmit
@opencode-ai/www:typecheck: $ blume check
@opencode-ai/www:typecheck: �[33m�[1mBLUME_NAV_DUPLICATE_LABEL�[0m Duplicate sidebar label "/experimental/project/{projectID}/copy" appears 2 times under "Projectcopy".
@opencode-ai/www:typecheck: �[36mfix: Give the entries distinct titles.�[0m
@opencode-ai/www:typecheck: �[2mdocs: https://useblume.dev/docs/content/navigation�[0m
@opencode-ai/www:typecheck:
@opencode-ai/www:typecheck: 1 warning(s)
@opencode-ai/www:typecheck: (node:28793) Warning: --localstorage-file was provided without a valid path
@opencode-ai/www:typecheck: (Use node --trace-warnings ... to show where the warning was created)
@opencode-ai/www:typecheck: [blume] ◐ Type-checking 138 page(s)
@opencode-ai/www:typecheck: Result (11 files):
@opencode-ai/www:typecheck: - 0 errors
@opencode-ai/www:typecheck: - 0 warnings
@opencode-ai/www:typecheck: - 0 hints
@opencode-ai/www:typecheck:
@opencode-ai/www:typecheck: [blume] ✔ No type errors.
@opencode-ai/console-support:typecheck: cache hit, replaying logs 3aa2767ed87f03a4
@opencode-ai/console-support:typecheck: $ tsgo --noEmit
@opencode-ai/codemode:typecheck: cache hit, replaying logs ba13f5d5dbbf3013
@opencode-ai/codemode:typecheck: $ tsgo --noEmit
@opencode-ai/enterprise:typecheck: cache hit, replaying logs d005ad6398b23b15
@opencode-ai/enterprise:typecheck: $ tsgo --noEmit
@opencode-ai/core:typecheck: cache hit, replaying logs 637aa31904385c23
@opencode-ai/core:typecheck: $ tsgo --noEmit
@opencode-ai/schema:typecheck: cache hit, replaying logs 494ead142381931a
@opencode-ai/httpapi-codegen:typecheck: cache hit, replaying logs a311f450e169c791
@opencode-ai/schema:typecheck: $ tsgo --noEmit
@opencode-ai/util:typecheck: cache hit, replaying logs 4ea0762bca38d410
@opencode-ai/httpapi-codegen:typecheck: $ tsgo --noEmit
@opencode-ai/server:typecheck: cache hit, replaying logs 11e24744aea511ed
@opencode-ai/util:typecheck: $ tsgo --noEmit
@opencode-ai/effect-sqlite-node:typecheck: cache hit, replaying logs 6eabc3f27f25bff4
@opencode-ai/server:typecheck: $ tsgo --noEmit
@opencode-ai/effect-drizzle-sqlite:typecheck: cache hit, replaying logs 15d904cf0acd3a1b
@opencode-ai/effect-drizzle-sqlite:typecheck: $ tsgo --noEmit
@opencode-ai/ui:typecheck: cache hit, replaying logs 3f4a0cba738a5ee0
@opencode-ai/effect-sqlite-node:typecheck: $ tsgo --noEmit
@opencode-ai/ui:typecheck: $ tsgo --noEmit
@opencode-ai/slack:typecheck: cache hit, replaying logs 819fd2fd96323f79
@opencode-ai/slack:typecheck: $ tsgo --noEmit
@opencode-ai/ai:typecheck: cache hit, replaying logs c65ab4ecabfa4769
@opencode-ai/ai:typecheck: $ tsgo --noEmit && tsgo --noEmit -p tsconfig.types.json
@opencode-ai/app:typecheck: cache hit, replaying logs 30f9c0deb4bc99c2
@opencode-ai/app:typecheck: $ tsgo -b
@opencode-ai/sdk-next:typecheck: cache hit, replaying logs a7b69d6611b1702b
@opencode-ai/sdk-next:typecheck: $ tsgo --noEmit

Tasks: 32 successful, 32 total
Cached: 32 cached, 32 total
Time: 204ms >>> FULL TURBO (38/38 packages passed).

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

rekram1-node and others added 30 commits July 19, 2026 10:28
Co-authored-by: Aiden Cline <rekram1-node@users.noreply.github.com>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: Simon Klee <hello@simonklee.dk>
Centralize session target resolution for mini and noninteractive
run paths. Recover from transport drops, replace questions with
forms, and keep tool/catalog state location-scoped with live
progress and theme discovery.
Co-authored-by: Aiden Cline <rekram1-node@users.noreply.github.com>
Co-authored-by: Aiden Cline <rekram1-node@users.noreply.github.com>
)

Co-authored-by: James Long <longster@gmail.com>
simonklee and others added 26 commits July 27, 2026 10:42
Co-authored-by: Kit Langton <kit.langton@gmail.com>
@loulanyue

Copy link
Copy Markdown
Author

Closing as superseded by merged #39238, which now bounds glob/grep execution and resolves #39208. No duplicate follow-up is needed here.

@loulanyue loulanyue closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools: v2 glob/grep run unbounded — no default timeout, one call hung a session for 21 minutes

8 participants